<template>
	<div class="main">
		<div class="cover_c">
			<div class="cover">
				<img src="https://xxx.oss.com/dxdh/%E8%92%99%E7%89%88%E7%BB%84%201.png" alt=""
					style="width:100%;height:100%">
			</div>
		</div>
		<div class="content">
			<div class="titletop">
				<div>基准志愿</div>
			</div>
			<div class="middle">
				<!-- <div class="blue"></div> -->
				<div class="detail">与考生“往年当量”相匹配对应的所有院校志愿。</div>
			</div>
			<titles :subtitle="subtitles">
			</titles>
			<!-- <div class="explain" style="display:flex">
				基于您的"往年当量"，推荐以下学校作为您平行志愿中的"基准志愿"
				<div style="float:right;color:rgba(51, 170, 255, 1);cursor:pointer;display:flex;margin-left:15px" @click="open">
					详细
					<div style="float">
						<i class="el-icon-arrow-down" v-if="!expanded"></i>
					</div>
					<div style="float">
						<i class="el-icon-arrow-up" v-if="expanded"></i>
					</div>
				</div>
			</div>
			<div class="detail" v-if="!expanded">点击“基准志愿”：与考生“往年当量”相匹配对应的所有院校志愿。</div> -->
			<div class="table">
				<tables :color="color" :tableData="tableData" :basicstatus='status' @selection='handleSelection'
					v-if="showFlag" :showMore="showmore"></tables>
				<!-- <tabless></tabless> -->
			</div>
			<div class="leftside">
				<div class="cndns-right-btn">
					<el-link @click="jumpTo('/informationfilling')" :underline="false">
						<i class="el-icon-s-home"></i>
						<div class="text">首页</div>
					</el-link>
				</div>
				<div class="cndns-right-btn">
					<!-- <el-tooltip class="item" effect="light" content="进入往年当量" hide-after="5000" placement="left-start"> -->
					<el-link @click="jumpTo('/Amount')" :underline="false">
						<i class="iconfont icon-shangyiye"></i>
						<div class="text">往年当量</div>
					</el-link>
					<!-- </el-tooltip> -->
				</div>
				<div class="cndns-right-btn">
					<!-- <el-tooltip class="item" effect="light" content="进入往年当量" hide-after="5000" placement="left-start"> -->
					<el-link @click="jumpTo('/voluntarygroup')" :underline="false">
						<i class="iconfont icon-xiayiye"></i>
						<div class="text">海选方案</div>
					</el-link>
					<!-- </el-tooltip> -->
				</div>
			</div>
			<!-- <div class="select">
				<el-button class="left" @click="jumpTo('/Amount')">返回“往年当量”</el-button>
				<el-button class="right" type="primary" @click="jumpTo('/voluntarygroup')">进入“海选”方案</el-button>
			</div> -->


		</div>
	</div>
</template>

<script>
	import titles from '../components/Title'
	import tables from '../components/Table'
	import timeCalculate from '../common/timeCalculate'
	export default {
		components: {
			titles,
			tables,
		},
		data() {
			return {
				subtitles: '三、我的"基准志愿":',
				color: "#33AAFF",
				showFlag: false,
				selection: [],
				tableData: [],
				status: true,
				showmore: 0,
				expanded: false, //折叠面板是否展开 
				lastData: {
					score: 640,
					year: 2019,
					pointsDifference: 99,
					ranking: 12345
				}
				// tableData: [{
				// number: '12345',
				// name: '浙江中医药大学',
				// control: '499',
				// plan:'70',
				// minScore:'555',
				// minAmount:'66',
				// ranking:'44734',
				// }, {
				// number: '11030',
				// name: '电子科技大学中山学院',
				// control: '499',
				// plan:'70',
				// minScore:'555',
				// minAmount:'66',
				// ranking:'44734',
				// }, {
				// number: '28100',
				// name: '安徽工业大学',
				// control: '499',
				// plan:'70',
				// minScore:'555',
				// minAmount:'66',
				// ranking:'44734',
				// }, 
				// {
				// number: '58350',
				// name: '成都医学院',
				// control: '499',
				// plan:'70',
				// minScore:'555',
				// minAmount:'66',
				// ranking:'44734',
				// },
				// {
				// number: '25400',
				// name: '河北科技大学',
				// control: '499',
				// plan:'70',
				// minScore:'555',
				// minAmount:'66',
				// ranking:'44734',
				// },
				// {
				// number: '25400',
				// name: '河北科技大学',
				// control: '499',
				// plan:'70',
				// minScore:'555',
				// minAmount:'66',
				// ranking:'44734',
				// },
				// {
				// number: '25400',
				// name: '河北科技大学',
				// control: '499',
				// plan:'70',
				// minScore:'555',
				// minAmount:'66',
				// ranking:'44734',
				// },
				// ],
			}
		},
		methods: {
			//点击详情 切换图标
			open() {
				this.expanded = !this.expanded;
				console.log(this.expanded)
			},
			jumpTo(router) {
				// this.showmore=1
				this.$router.push(router)
			},
			handleSelection(data) {
				this.selection = data
				console.log(this.selection);
			},
			//获取分数相当量
			getEquivalent() {
				let username = JSON.parse(sessionStorage.username)
				this.$axios.post(`${this.baseURL}/equivalent/myEquivalent?username=${username}`).then(res => {
					this.lastData = res.data.data
					sessionStorage.setItem('equivalent', JSON.stringify(res.data.data))
					this.getBenchmarkVolunteer()
				})

			},
			//获取基准志愿
			getBenchmarkVolunteer() {
				// let year = timeCalculate.timeCalculate() - 1
				console.log(this.lastData);
				let equivalent = this.lastData
				let formData = JSON.parse(sessionStorage.form)
				this.$axios({
						method: 'POST',
						url: `${this.baseURL}/benchmarkVolunteer/getMyBenchmarkVolunteer`,
						data: {
							batch: formData.batch,
							equivalentScore: equivalent.score,
							provinceId: formData.provinceId,
							subject: formData.subject,
							username: JSON.parse(sessionStorage.username),
							year: equivalent.year
						}
					})
					.then(res => {
						console.log(res.data.data);
						this.tableData = res.data.data
						equivalent.score = this.tableData[0].minCastScore
						sessionStorage.setItem('equivalent', JSON.stringify(equivalent))
						this.showFlag = true
					})
			}
		},
		mounted() {
			this.getEquivalent();

		}
	}
</script>

<style scoped>
	.content {
		width: 1440px;
		min-height: 850px;
		background-color: #fff;
		margin: 100px auto;
		/* position: relative; */
		margin-bottom: 24px;
		z-index: 2;
		position: relative;
	}
	.content>>>.title{
		height:30px!important;
	}
	.titletop {
		width: 100%;
		height: 100px;
		font-size: 40px;
		font-family: Noto Sans SC;
		/* line-height: 71px; */
		color: #000000;
		/* margin: 0 auto; */
		font-weight: 700;
		/* margin-top: 80px; */
		letter-spacing: 2px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.explain {
		font-size: 22px;
		font-family: Source Han Sans;
		font-weight: 400;
		line-height: 41px;
		color: rgba(0, 0, 0, 0.45);
		width: 800px;
		height: 41px;
		margin-left: 104px;
		margin-top: 24px;
		text-align: left;
	}

	.table {
		width: 1330px;
		margin: 0 auto;
		margin-top: 0.15rem;
		/* margin-bottom: 60px; */
		/* height: 1000px; */
	}

	.select {
		width: 750px;

		/* margin-bottom: 70px; */
		/* height: 150px; */
		left: 0;
		right: 0;
		bottom: 0;
		position: fixed;
		margin: auto;
	}

	.select .left {
		width: 347px;
		height: 62px;
		color: rgba(51, 170, 255, 1);
		float: left;
		font-size: 24px;
		font-family: Source Han Sans;
		font-weight: 100;
		line-height: 41px;
		border: 2px solid #33AAFF;
		border-radius: 10px;
	}

	.select .right {
		width: 347px;
		height: 62px;
		float: right;
		font-size: 24px;
		font-family: Source Han Sans;
		font-weight: 100;
		line-height: 41px;
		border-radius: 10px;
	}

	.middle {
		display: flex;
		justify-content: center;
		flex-direction: row;

		/* margin-top:50px; */
		/* margin-bottom: 47px; */
	}

	.blue {
		width: 8px;
		height: 40px;
		background: #33AAFF;
		margin-left: 88px;
	}

	.subtitle {
		/* width: 256px; */
		/* height: 32px; */
		font-size: 32px;
		font-family: Noto Sans SC;
		font-weight: 500;
		line-height: 43px;
		color: #000000;
		margin-left: 10px;
		letter-spacing: 1px;
	}

	.detail {
		font-size: 22px;
		font-family: Noto Sans SC;
		font-weight: 600;
		/* margin: 0.0625rem auto; */
		/* margin-left: 0.541667rem; */
		width: 5.9114rem;
		text-align: center;
		/* margin-top: 0.0625rem; */
		color: #aaabaa;
	}

	.cover {
		position: absolute;
		top: -210px;
		z-index: 0;
		/* width: 1900px; */
		height: 276px;
		/* text-align: center; */
		left: 50%;
		margin-left: -960px;
		overflow: hidden;
	}

	.cover_c {
		position: relative;
		width: 100%;
	}

	.leftside {
		position: fixed;
		right: 5%;
		width: 85px;
		min-height: 48px;
		height: 300px;
		top: 50%;
		z-index: 100;
		box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
		border-radius: 40px;
		/* border: 10px solid black; */
		box-sizing: border-box;
		background: #fff;

	}

	.cndns-right-btn {
		border-radius: 40px;
		width: 100%;
		height: 30%;
		/* text-align: center; */
		display: block;
		margin-top: 10px;

		background-color: #fff;
	}

	i {
		font-size: 28px;
	}

	.text {
		font-size: 20px;
		font-family: Source Han Sans;
		font-weight: bold;
	}
</style>
